<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<title>登录</title>
		<%@include file="/common/header.jsp" %>
		
		<link rel="stylesheet" href="${basePath }css/login.css"/>
	</head>
	<body>
		<%@include file="/common/top.jsp" %>
		
		<div class="_loginFrame">
			<form action="${basePath }user_login.action" method="POST"  id="loginForm">
				<div class="_login">
					<div class="_login_title">
						<h2>帐号密码登录</h2>
					</div>
					<div class="_login_text">
						<div class="_login_account_img_acc"></div>
						<div class="_login_account">
							<s:textfield id="account" name="user.account"></s:textfield>
						</div>
					</div>
					<div class="_login_text">
						<div class="_login_account_img_pwd"></div>
						<div class="_login_account">
							<s:password id="password" name="user.password"></s:password>
						</div>
					</div>
					<div class="_login_btn">
						<input class="_login_btn_sub" type="button" value="登录" onclick="doSubmit()"/>
					</div>
					<div class="_login_register">
						
						<h2><font color="red">${msg }</font>&nbsp;<a href="${basePath }home_toHomePageUI.action">回到首页</a>&nbsp;<a href="${basePath }user_toRegisterUI.action">注册用户</a></h2>
					</div>
				</div>
			</form>
		</div>
		
		
		<script type="text/javascript">
			function doSubmit(){
				//先进行表单校验
				var accinfo = $('#account').val();		
				if(accinfo.length < 4 || accinfo.length >16){
					alert('帐号不能为空,并且长度为4-16个字符');
					$('#account').focus();	
					return false;
				}
				var pwdinfo = $('#password').val();		
				if(pwdinfo.length < 4 || pwdinfo.length >16){
					alert('密码不能为空,并且长度为4-16个字符');
					$('#password').focus();	
					return false;
				}

				//提交表单
				$("#loginForm").submit();
			}
		</script>
		<%@include file="/common/footer.jsp" %>
	</body>
</html>